package com.msh.frame.client.enums;

import com.msh.frame.client.define.StringDef;
import com.msh.frame.interfaces.IValueDescEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum StatusEnum implements IValueDescEnum {
  NORMAL(1, "正常"),
  DISABLE(2, "禁用");

  private Integer value;
  private String desc;


  public static String valueToDesc(Integer code) {
    for (StatusEnum statusEnum : values()) {
      if (statusEnum.value.equals(code)) {
        return statusEnum.getDesc();
      }
    }
    return StringDef.EMPTY;
  }


}
